<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta content="Cask Data, Inc." name="author" />
<meta content="HTTP RESTful Interface to the Cask Data Application Platform" name="description" />
<meta content="Copyright © 2015-2017 Cask Data, Inc." name="copyright" />


    <meta name="git_release" content="6.1.1">
    <meta name="git_hash" content="05fbac36f9f7aadeb44f5728cea35136dbc243e5">
    <meta name="git_timestamp" content="2020-02-09 08:22:47 +0800">
    <title>Artifact HTTP RESTful API</title>

    <link rel="stylesheet" href="../_static/cdap-bootstrap.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../_static/bootstrap-3.3.6/css/bootstrap.min.css" type="text/css" />
    <link rel="stylesheet" href="../_static/bootstrap-3.3.6/css/bootstrap-theme.min.css" type="text/css" />
    <link rel="stylesheet" href="../_static/css/bootstrap-sphinx.css" type="text/css" />
    <link rel="stylesheet" href="../_static/css/cdap-dynamicscrollspy-4.css" type="text/css" />
    <link rel="stylesheet" href="../_static/css/jquery.mCustomScrollbar.css" type="text/css" />
    <link rel="stylesheet" href="../_static/css/cdap-jquery.mCustomScrollbar.css" type="text/css" />
    <link rel="stylesheet" href="../_static/css/abixTreeList-2.css" type="text/css" />
    <link rel="stylesheet" href="../_static/cdap-bootstrap.css" type="text/css" />

    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '6.1.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  false
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/language_data.js"></script>

    <link rel="shortcut icon" href="../_static/favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="top" title="Cask Data Application Platform 6.1.1 Documentation" href="../index.html" />
    <link rel="up" title="CDAP HTTP RESTful API v3" href="index.html" />
    <link rel="next" title="Configuration HTTP RESTful API" href="configuration.html" />
    <link rel="prev" title="Introduction" href="introduction.html" />
    <!-- block extrahead -->
    <meta charset='utf-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
    <meta name="apple-mobile-web-app-capable" content="yes">
    <!-- block extrahead end -->

</head>
<body role="document">

<!-- block navbar -->
<div id="navbar" class="navbar navbar-inverse navbar-default navbar-fixed-top">
    <div class="container-fluid">
      <div class="row">
        <div class="navbar-header">
          <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
          <a class="navbar-brand" href="../table-of-contents/../../index.html">
            <span><img alt="CDAP logo" src="../_static/cdap_logo.svg"/></span>
          </a>

          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>

          <div class="pull-right">
            <div class="dropdown version-dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown"
                role="button" aria-haspopup="true" aria-expanded="false">
                v 6.1.1 <span class="caret"></span>
              </a>
              <ul class="dropdown-menu">
                <li><a href="//docs.cdap.io/cdap/5.1.2/en/index.html">v 5.1.2</a></li>
                <li><a href="//docs.cdap.io/cdap/4.3.4/en/index.html">v 4.3.4</a></li>
              </ul>
            </div>
          </div>
          <form class="navbar-form navbar-right navbar-search" action="../search.html" method="get">
            <div class="form-group">
              <div class="navbar-search-image material-icons"></div>
              <input type="text" name="q" class="form-control" placeholder="  Search" />
            </div>
            <input type="hidden" name="check_keywords" value="yes" />
            <input type="hidden" name="area" value="default" />
          </form>

          <div class="collapse navbar-collapse nav-collapse navbar-right navbar-navigation">
            <ul class="nav navbar-nav"><li class="docsite-nav-tab-container"><a class="docsite-nav-tab-link " href="../table-of-contents/../../index.html">简介</a></li><li class="docsite-nav-tab-container"><a class="docsite-nav-tab-link " href="../table-of-contents/../../guides.html">手册</a></li><li class="docsite-nav-tab-container"><a class="docsite-nav-tab-link current" href="../table-of-contents/../../reference-manual/index.html">参考</a></li><li class="docsite-nav-tab-container"><a class="docsite-nav-tab-link " href="../table-of-contents/../../faqs/index.html">帮助</a></li>
            </ul>
          </div>

        </div>
      </div>
    </div>
  </div><!-- block navbar end -->
<!-- block main content -->
<div class="main-container container">
  <div class="row"><div class="col-md-2">
      <div id="sidebar" class="bs-sidenav scrollable-y-outside" role="complementary">
<!-- theme_manual: reference-manual -->
<!-- theme_manual_highlight: reference -->
<!-- sidebar_title_link: Reference -->

  <div role="note" aria-label="manuals links"><h3>Reference</h3>
    <ul class="reference-page-menu">
      <nav class="pagenav">
      <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../index.html"> Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../characters.html"> Supported Characters</a></li>
<li class="toctree-l1"><a class="reference internal" href="../cli-api.html"> Command Line Interface API</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html"> HTTP RESTful API</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="introduction.html">Introduction</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Artifact</a></li>
<li class="toctree-l2"><a class="reference internal" href="configuration.html">Configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="dataset.html">Dataset</a></li>
<li class="toctree-l2"><a class="reference internal" href="lifecycle.html">Lifecycle</a></li>
<li class="toctree-l2"><a class="reference internal" href="logging.html">Logging</a></li>
<li class="toctree-l2"><a class="reference internal" href="metadata.html">Metadata</a></li>
<li class="toctree-l2"><a class="reference internal" href="metrics.html">Metrics</a></li>
<li class="toctree-l2"><a class="reference internal" href="monitor.html">Monitor</a></li>
<li class="toctree-l2"><a class="reference internal" href="namespace.html">Namespace</a></li>
<li class="toctree-l2"><a class="reference internal" href="dashboard.html">Dashboard</a></li>
<li class="toctree-l2"><a class="reference internal" href="preferences.html">Preferences</a></li>
<li class="toctree-l2"><a class="reference internal" href="profile.html">Profile</a></li>
<li class="toctree-l2"><a class="reference internal" href="query.html">Query</a></li>
<li class="toctree-l2"><a class="reference internal" href="reports.html">Reports</a></li>
<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li>
<li class="toctree-l2"><a class="reference internal" href="service.html">Service</a></li>
<li class="toctree-l2"><a class="reference internal" href="transactions.html">Transactions</a></li>
<li class="toctree-l2"><a class="reference internal" href="workflow.html">Workflow</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../java-client-api.html"> Java Client API</a></li>
<li class="toctree-l1"><a class="reference internal" href="../javadocs/index.html"> Javadocs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../release-notes.html"> 发行说明</a></li>
<li class="toctree-l1"><a class="reference internal" href="../licenses/index.html"> Trademarks, Licenses, and Dependencies</a></li>
<li class="toctree-l1"><a class="reference internal" href="../glossary.html"> 术语表</a></li>
<li class="toctree-l1"><a class="reference internal" href="../genindex.html"> Index</a></li>
</ul>
</nav>
    </ul>
  </div></div>
    </div><div class="col-md-8 content" id="main-content">
    
  <div class="section" id="artifact-http-restful-api">
<span id="http-restful-api-artifact"></span><h1>Artifact HTTP RESTful API<a class="headerlink" href="#artifact-http-restful-api" title="Permalink to this headline">🔗</a></h1>
<p>Use the CDAP Artifact HTTP RESTful API to deploy artifacts, list available artifacts, and
retrieve information about plugins available to artifacts. Artifacts, their use, and
examples of using them, are described in the
<a class="reference external" href="../../../developer-manual/building-blocks/artifacts.html#artifacts" title="(in Cask Data Application Platform v6.1.1)"><span class="xref std std-ref">开发手册: Artifacts</span></a>.</p>
<p>All methods or endpoints described in this API have a base URL (typically
<code class="docutils literal notranslate"><span class="pre">http://&lt;host&gt;:11015</span></code> or <code class="docutils literal notranslate"><span class="pre">https://&lt;host&gt;:10443</span></code>) that precedes the resource
identifier, as described in the <a class="reference internal" href="introduction.html#http-restful-api-conventions-base-url"><span class="std std-ref">RESTful API Conventions</span></a>.
These methods return a status code, as listed in the <a class="reference internal" href="introduction.html#http-restful-api-status-codes"><span class="std std-ref">RESTful API  Status Codes</span></a>.</p>
<div class="section" id="add-an-artifact">
<span id="http-restful-api-artifact-add"></span><h2>Add an Artifact<a class="headerlink" href="#add-an-artifact" title="Permalink to this headline">🔗</a></h2>
<p>An artifact can be added (loaded) with an HTTP POST method to the URL:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">POST /v3/namespaces/&lt;namespace-id&gt;/artifacts/&lt;artifact-name&gt;</span>
</pre></div>
</div>
<p>The request body must contain the binary contents of the artifact.</p>
<table border="1" class="docutils">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Parameter</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">namespace-id</span></code></td>
<td>Namespace ID</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">artifact-name</span></code></td>
<td>Name of the artifact to be created</td>
</tr>
</tbody>
</table>
<p>Several optional headers may also be specified:</p>
<table border="1" class="docutils">
<colgroup>
<col width="20%" />
<col width="40%" />
<col width="40%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Header</th>
<th class="head">Description</th>
<th class="head">Example</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><strong>Artifact-Version</strong></td>
<td>The version of the artifact to add. If not specified, the <code class="docutils literal notranslate"><span class="pre">Bundle-Version</span></code> attribute
in the JAR file’s Manifest will be used.</td>
<td><code class="docutils literal notranslate"><span class="pre">1.0.0</span></code></td>
</tr>
<tr class="row-odd"><td><strong>Artifact-Extends</strong></td>
<td>If the artifact contains plugins, describes which parent artifacts should have access to those plugins.
Multiple parents can be given by separating them with a <code class="docutils literal notranslate"><span class="pre">/</span></code></td>
<td><code class="docutils literal notranslate"><span class="pre">cdap-data-pipeline[3.2.0,5.0.0)/cdap-data-streams[3.2.0,5.0.0)</span></code></td>
</tr>
<tr class="row-even"><td><strong>Artifact-Plugins</strong></td>
<td>JSON Array of plugins contained in the artifact that are not annotated as a plugin.
This should be used for third-party JARs that need to be plugins, such as JDBC drivers. Each element
in the array is a JSON object containing name, type, and className of the plugin.</td>
<td><code class="docutils literal notranslate"><span class="pre">[</span> <span class="pre">{</span> <span class="pre">&quot;name&quot;:</span> <span class="pre">&quot;mysql&quot;,</span> <span class="pre">&quot;type&quot;:</span> <span class="pre">&quot;jdbc&quot;,</span> <span class="pre">&quot;className&quot;:</span> <span class="pre">&quot;com.mysql.jdbc.Driver&quot;</span> <span class="pre">}</span> <span class="pre">]</span></code></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="list-available-artifacts">
<span id="http-restful-api-artifact-available"></span><h2>List Available Artifacts<a class="headerlink" href="#list-available-artifacts" title="Permalink to this headline">🔗</a></h2>
<p>To retrieve a list of available artifacts, submit an HTTP GET request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">GET /v3/namespaces/&lt;namespace-id&gt;/artifacts[?scope=&lt;scope&gt;]</span>
</pre></div>
</div>
<table border="1" class="docutils">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Parameter</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">namespace-id</span></code></td>
<td>Namespace ID</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">scope</span></code></td>
<td>Optional scope filter. If not specified, artifacts in the <code class="docutils literal notranslate"><span class="pre">user</span></code> and
<code class="docutils literal notranslate"><span class="pre">system</span></code> scopes are returned. Otherwise, only artifacts in the specified scope are returned.</td>
</tr>
</tbody>
</table>
<p>This will return a JSON array that lists each artifact with its name, version, and scope.
Example output (pretty-printed):</p>
<div class="highlight container">
<pre class="literal-block">
<span class="gp">$</span> GET /v3/namespaces/default/artifacts
[
  {
    &quot;name&quot;: &quot;cdap-data-pipeline&quot;,
    &quot;scope&quot;: &quot;SYSTEM&quot;,
    &quot;version&quot;: &quot;6.1.1&quot;
  },
  {
    &quot;name&quot;: &quot;cdap-data-streams&quot;,
    &quot;scope&quot;: &quot;SYSTEM&quot;,
    &quot;version&quot;: &quot;6.1.1&quot;
  },
  {
    &quot;name&quot;: &quot;Purchase&quot;,
    &quot;scope&quot;: &quot;USER&quot;,
    &quot;version&quot;: &quot;6.1.1&quot;
  }
]
</pre>
</div>
</div>
<div class="section" id="list-artifact-versions">
<span id="http-restful-api-artifact-versions"></span><h2>List Artifact Versions<a class="headerlink" href="#list-artifact-versions" title="Permalink to this headline">🔗</a></h2>
<p>To list all versions or a specific range of versions of an artifact, submit an HTTP GET request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">GET /v3/namespaces/&lt;namespace-id&gt;/artifact/&lt;artifact-name&gt;[?scope=&lt;scope&gt;&amp;artifactVersion=&lt;artifact-version&gt;&amp;limit=&lt;limit&gt;&amp;order=&lt;order&gt;]</span>
</pre></div>
</div>
<table border="1" class="docutils">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Parameter</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">namespace-id</span></code></td>
<td>Namespace ID</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">artifact-name</span></code></td>
<td>Name of the artifact</td>
</tr>
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">scope</span></code></td>
<td>Optional scope filter. If not specified, defaults to <code class="docutils literal notranslate"><span class="pre">user</span></code>.</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">artifact-version</span></code></td>
<td>Optional version range filter. All versions within this range will be returned.
It can be an exact version such as <code class="docutils literal notranslate"><span class="pre">1.0.0</span></code> or a version range such as <code class="docutils literal notranslate"><span class="pre">[1.0.0,</span> <span class="pre">2.0.0)</span></code>.
If not specified, defaults to returning all versions.</td>
</tr>
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">limit</span></code></td>
<td>Optional limit filter. Limits the number of the returned results. If not specified,
defaults to returning all artifacts which match the requirements.</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">order</span></code></td>
<td>Optional order filter. Accepted values are one of <code class="docutils literal notranslate"><span class="pre">DESC</span></code>, <code class="docutils literal notranslate"><span class="pre">ASC</span></code>, or
<code class="docutils literal notranslate"><span class="pre">UNORDERED</span></code>. <code class="docutils literal notranslate"><span class="pre">DESC</span></code> will sort the artifacts by version from
highest to lowest; for <code class="docutils literal notranslate"><span class="pre">ASC</span></code>, sorted by version from lowest
to highest. If not specified, defaults to <code class="docutils literal notranslate"><span class="pre">UNORDERED</span></code>.</td>
</tr>
</tbody>
</table>
<p>This will return a JSON array that lists each version of the specified artifact with
its name, version, and scope. Example output for the <code class="docutils literal notranslate"><span class="pre">cdap-data-pipeline</span></code> artifact (pretty-printed):</p>
<div class="highlight container">
<pre class="literal-block">
<span class="gp">$</span> GET /v3/namespaces/default/artifacts/cdap-data-pipeline?scope=system
[
  {
    &quot;name&quot;: &quot;cdap-data-pipeline&quot;,
    &quot;scope&quot;: &quot;SYSTEM&quot;,
    &quot;version&quot;: &quot;6.1.1&quot;
  }
]
</pre>
</div>
</div>
<div class="section" id="retrieve-artifact-details">
<span id="http-restful-api-artifact-detail"></span><h2>Retrieve Artifact Details<a class="headerlink" href="#retrieve-artifact-details" title="Permalink to this headline">🔗</a></h2>
<p>To retrieve details about a specific version of an artifact, submit an HTTP GET request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">GET /v3/namespaces/&lt;namespace-id&gt;/artifacts/&lt;artifact-name&gt;/versions/&lt;artifact-version&gt;[?scope=&lt;scope&gt;]</span>
</pre></div>
</div>
<table border="1" class="docutils">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Parameter</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">namespace-id</span></code></td>
<td>Namespace ID</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">artifact-name</span></code></td>
<td>Name of the artifact</td>
</tr>
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">artifact-version</span></code></td>
<td>Version of the artifact</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">scope</span></code></td>
<td>Optional scope filter. If not specified, defaults to ‘user’.</td>
</tr>
</tbody>
</table>
<p>This will return a JSON object that contains information about: classes in the artifact;
the schema of the config object supported by the <code class="docutils literal notranslate"><span class="pre">Application</span></code> class; and the artifact name,
version, and scope. Example output for version <code class="docutils literal notranslate"><span class="pre">6.1.1</span></code> of the <code class="docutils literal notranslate"><span class="pre">WordCount</span></code>
artifact (pretty-printed and reformatted to fit):</p>
<div class="highlight container">
<pre class="literal-block">
<span class="gp">$</span> GET /v3/namespaces/default/artifact/WordCount/versions/6.1.1?scope=system
{
  &quot;classes&quot;: {
    &quot;apps&quot;: [
      {
        &quot;className&quot;: &quot;io.cdap.cdap.examples.wordcount.WordCount&quot;,
        &quot;configSchema&quot;: {
          &quot;fields&quot;: [
            { &quot;name&quot;: &quot;stream&quot;, &quot;type&quot;: [ &quot;string&quot;, &quot;null&quot; ] },
            { &quot;name&quot;: &quot;uniqueCountTable&quot;, &quot;type&quot;: [ &quot;string&quot;, &quot;null&quot; ] },
            { &quot;name&quot;: &quot;wordAssocTable&quot;, &quot;type&quot;: [ &quot;string&quot;, &quot;null&quot; ] },
            { &quot;name&quot;: &quot;wordCountTable&quot;, &quot;type&quot;: [ &quot;string&quot;, &quot;null&quot; ] },
            { &quot;name&quot;: &quot;wordStatsTable&quot;, &quot;type&quot;: [ &quot;string&quot;, &quot;null&quot; ] }
          ],
          &quot;name&quot;: &quot;io.cdap.cdap.examples.wordcount.WordCount$WordCountConfig&quot;,
          &quot;type&quot;: &quot;record&quot;
        },
        &quot;description&quot;: &quot;&quot;
      }
    ],
    &quot;plugins&quot;: []
  },
  &quot;name&quot;: &quot;WordCount&quot;,
  &quot;scope&quot;: &quot;USER&quot;,
  &quot;version&quot;: &quot;6.1.1&quot;
}
</pre>
</div>
</div>
<div class="section" id="set-artifact-properties">
<span id="http-restful-api-artifact-set-properties"></span><h2>Set Artifact Properties<a class="headerlink" href="#set-artifact-properties" title="Permalink to this headline">🔗</a></h2>
<p>To set properties for a specific version of an artifact, submit an HTTP PUT request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">PUT /v3/namespaces/&lt;namespace-id&gt;/artifacts/&lt;artifact-name&gt;/versions/&lt;artifact-version&gt;/properties</span>
</pre></div>
</div>
<table border="1" class="docutils">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Parameter</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">namespace-id</span></code></td>
<td>Namespace ID</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">artifact-name</span></code></td>
<td>Name of the artifact</td>
</tr>
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">artifact-version</span></code></td>
<td>Version of the artifact</td>
</tr>
</tbody>
</table>
<p>The request body must be a JSON object that contains the properties for the artifact.
The keys and values in the object must be strings. If any properties are already
defined, they will be overwritten.</p>
<div class="highlight container">
<pre class="literal-block">
<span class="gp">$</span> PUT /v3/namespaces/default/artifact/WordCount/versions/6.1.1/properties -d
{
    &quot;author&quot;: &quot;samuel&quot;,
    &quot;company&quot;: &quot;cask&quot;
}
</pre>
</div>
</div>
<div class="section" id="set-an-artifact-property">
<span id="http-restful-api-artifact-set-property"></span><h2>Set an Artifact Property<a class="headerlink" href="#set-an-artifact-property" title="Permalink to this headline">🔗</a></h2>
<p>To set a specific property for a specific version of an artifact, submit an HTTP PUT request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">PUT /v3/namespaces/&lt;namespace-id&gt;/artifacts/&lt;artifact-name&gt;/versions/&lt;artifact-version&gt;/properties/&lt;property&gt;</span>
</pre></div>
</div>
<table border="1" class="docutils">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Parameter</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">namespace-id</span></code></td>
<td>Namespace ID</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">artifact-name</span></code></td>
<td>Name of the artifact</td>
</tr>
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">artifact-version</span></code></td>
<td>Version of the artifact</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">property</span></code></td>
<td>Property to set</td>
</tr>
</tbody>
</table>
<p>The request body must contain the value to set for the property. If the property already exists,
the previous value will be overwritten.</p>
<div class="highlight container">
<pre class="literal-block">
<span class="gp">$</span> PUT /v3/namespaces/default/artifact/WordCount/versions/6.1.1/properties/author -d
samuel
</pre>
</div>
</div>
<div class="section" id="retrieve-artifact-properties">
<span id="http-restful-api-artifact-retrieve-properties"></span><h2>Retrieve Artifact Properties<a class="headerlink" href="#retrieve-artifact-properties" title="Permalink to this headline">🔗</a></h2>
<p>To retrieve properties for a specific version of an artifact, submit an HTTP GET request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">GET /v3/namespaces/&lt;namespace-id&gt;/artifacts/&lt;artifact-name&gt;/versions/&lt;artifact-version&gt;/properties[?scope=&lt;scope&gt;&amp;keys=&lt;keys&gt;]</span>
</pre></div>
</div>
<table border="1" class="docutils">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Parameter</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">namespace-id</span></code></td>
<td>Namespace ID</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">artifact-name</span></code></td>
<td>Name of the artifact</td>
</tr>
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">artifact-version</span></code></td>
<td>Version of the artifact</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">scope</span></code></td>
<td>Optional scope filter. If not specified, defaults to ‘user’.</td>
</tr>
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">keys</span></code></td>
<td>Optional comma-separated list of property keys to return. If not specified, all keys are returned.</td>
</tr>
</tbody>
</table>
<p>This will return a JSON object that contains the properties of the artifact.</p>
<div class="highlight container">
<pre class="literal-block">
<span class="gp">$</span> GET /v3/namespaces/default/artifact/WordCount/versions/6.1.1/properties?keys=author,company
{ &quot;author&quot;: &quot;samuel&quot;, &quot;company&quot;: &quot;cask&quot; }
</pre>
</div>
</div>
<div class="section" id="retrieve-an-artifact-property">
<span id="http-restful-api-artifact-retrieve-property"></span><h2>Retrieve an Artifact Property<a class="headerlink" href="#retrieve-an-artifact-property" title="Permalink to this headline">🔗</a></h2>
<p>To retrieve a specific property for a specific version of an artifact, submit an HTTP GET request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">GET /v3/namespaces/&lt;namespace-id&gt;/artifacts/&lt;artifact-name&gt;/versions/&lt;artifact-version&gt;/properties/&lt;property&gt;[?scope=&lt;scope&gt;]</span>
</pre></div>
</div>
<table border="1" class="docutils">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Parameter</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">namespace-id</span></code></td>
<td>Namespace ID</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">artifact-name</span></code></td>
<td>Name of the artifact</td>
</tr>
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">artifact-version</span></code></td>
<td>Version of the artifact</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">property</span></code></td>
<td>Property to retrieve</td>
</tr>
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">scope</span></code></td>
<td>Optional scope filter. If not specified, defaults to ‘user’.</td>
</tr>
</tbody>
</table>
<div class="highlight container">
<pre class="literal-block">
<span class="gp">$</span> GET /v3/namespaces/default/artifact/WordCount/versions/6.1.1/properties/author?scope=user
samuel
</pre>
</div>
</div>
<div class="section" id="delete-artifact-properties">
<span id="http-restful-api-artifact-delete-properties"></span><h2>Delete Artifact Properties<a class="headerlink" href="#delete-artifact-properties" title="Permalink to this headline">🔗</a></h2>
<p>To delete all properties for a specific version of an artifact, submit an HTTP DELETE request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">DELETE /v3/namespaces/&lt;namespace-id&gt;/artifacts/&lt;artifact-name&gt;/versions/&lt;artifact-version&gt;/properties</span>
</pre></div>
</div>
<table border="1" class="docutils">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Parameter</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">namespace-id</span></code></td>
<td>Namespace ID</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">artifact-name</span></code></td>
<td>Name of the artifact</td>
</tr>
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">artifact-version</span></code></td>
<td>Version of the artifact</td>
</tr>
</tbody>
</table>
<div class="highlight container">
<pre class="literal-block">
<span class="gp">$</span> DELETE /v3/namespaces/default/artifact/WordCount/versions/6.1.1/properties
</pre>
</div>
</div>
<div class="section" id="delete-an-artifact-property">
<span id="http-restful-api-artifact-delete-property"></span><h2>Delete an Artifact Property<a class="headerlink" href="#delete-an-artifact-property" title="Permalink to this headline">🔗</a></h2>
<p>To delete a specific property for a specific version of an artifact, submit an HTTP DELETE request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">DELETE /v3/namespaces/&lt;namespace-id&gt;/artifacts/&lt;artifact-name&gt;/versions/&lt;artifact-version&gt;/properties/&lt;property&gt;</span>
</pre></div>
</div>
<table border="1" class="docutils">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Parameter</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">namespace-id</span></code></td>
<td>Namespace ID</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">artifact-name</span></code></td>
<td>Name of the artifact</td>
</tr>
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">artifact-version</span></code></td>
<td>Version of the artifact</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">property</span></code></td>
<td>Property key to delete</td>
</tr>
</tbody>
</table>
<div class="highlight container">
<pre class="literal-block">
<span class="gp">$</span> DELETE /v3/namespaces/default/artifact/WordCount/versions/6.1.1/properties/author
</pre>
</div>
</div>
<div class="section" id="list-extensions-plugin-types-available-to-an-artifact">
<span id="http-restful-api-artifact-extensions"></span><h2>List Extensions (Plugin Types) available to an Artifact<a class="headerlink" href="#list-extensions-plugin-types-available-to-an-artifact" title="Permalink to this headline">🔗</a></h2>
<p>To list the extensions (plugin types) available to an artifact, submit
an HTTP GET request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">GET /v3/namespaces/&lt;namespace-id&gt;/artifacts/&lt;artifact-name&gt;/versions/&lt;artifact-version&gt;/extensions[?scope=&lt;scope&gt;]</span>
</pre></div>
</div>
<table border="1" class="docutils">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Parameter</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">namespace-id</span></code></td>
<td>Namespace ID</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">artifact-name</span></code></td>
<td>Name of the artifact</td>
</tr>
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">artifact-version</span></code></td>
<td>Version of the artifact</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">scope</span></code></td>
<td>Optional scope filter. If not specified, defaults to ‘user’.</td>
</tr>
</tbody>
</table>
<p>This will return a JSON array that lists the extensions (plugin types) available to the artifact.
Example output for version <code class="docutils literal notranslate"><span class="pre">6.1.1</span></code> of the <code class="docutils literal notranslate"><span class="pre">cdap-data-pipeline</span></code> artifact:</p>
<div class="highlight container">
<pre class="literal-block">
<span class="gp">$</span> GET /v3/namespaces/default/artifacts/cdap-data-pipeline/versions/6.1.1/extensions?scope=system
[&quot;sparksink&quot;,&quot;postaction&quot;,&quot;transform&quot;,&quot;batchaggregator&quot;,&quot;sparkcompute&quot;,&quot;validator&quot;,&quot;realtimesource&quot;,&quot;action&quot;,&quot;batchsource&quot;,&quot;realtimesink&quot;,&quot;batchsink&quot;,&quot;batchjoiner&quot;]
</pre>
</div>
</div>
<div class="section" id="list-plugins-available-to-an-artifact">
<span id="http-restful-api-artifact-available-plugins"></span><h2>List Plugins available to an Artifact<a class="headerlink" href="#list-plugins-available-to-an-artifact" title="Permalink to this headline">🔗</a></h2>
<p>To list plugins of a specific type available to an artifact, submit
an HTTP GET request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">GET /v3/namespaces/&lt;namespace-id&gt;/artifacts/&lt;artifact-name&gt;/versions/&lt;artifact-version&gt;/extensions/&lt;plugin-type&gt;[?scope=&lt;scope&gt;]</span>
</pre></div>
</div>
<table border="1" class="docutils">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Parameter</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">namespace-id</span></code></td>
<td>Namespace ID</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">artifact-name</span></code></td>
<td>Name of the artifact</td>
</tr>
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">artifact-version</span></code></td>
<td>Version of the artifact</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">plugin-type</span></code></td>
<td>Type of plugins to list</td>
</tr>
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">scope</span></code></td>
<td>Optional scope filter. If not specified, defaults to ‘user’.</td>
</tr>
</tbody>
</table>
<p>This will return a JSON array that lists the plugins of the specified type
available to the artifact. Each element in the array is a JSON object containing
the artifact that the plugin originated from, and the plugin’s class name, description,
name, and type. Note that the details provided are a summary compared to those provided by
the endpoint <a class="reference internal" href="#http-restful-api-artifact-plugin-detail"><span class="std std-ref">Retrieve Plugin Details</span></a>.</p>
<p>Example output for plugins of type <code class="docutils literal notranslate"><span class="pre">transform</span></code> available to version <code class="docutils literal notranslate"><span class="pre">6.1.1</span></code>
of the <code class="docutils literal notranslate"><span class="pre">cdap-data-pipeline</span></code> artifact (pretty-printed and reformatted to fit):</p>
<div class="highlight container">
<pre class="literal-block">
<span class="gp">$</span> GET /v3/namespaces/default/artifacts/cdap-data-pipeline/versions/6.1.1/extensions/transform?scope=system

[
    {
        &quot;name&quot;: &quot;LogParser&quot;,
        &quot;type&quot;: &quot;transform&quot;,
        &quot;description&quot;: &quot;Parses logs from any input source for relevant information such as
            URI, IP, browser, device, HTTP status code, and timestamp.&quot;,
        &quot;className&quot;: &quot;io.cdap.hydrator.plugin.transform.LogParserTransform&quot;,
        &quot;artifact&quot;: {
            &quot;name&quot;: &quot;core-plugins&quot;,
            &quot;version&quot;: &quot;<a href="#id1"><span class="problematic" id="id2">|cdap-pipelines-version|</span></a>&quot;,
            &quot;scope&quot;: &quot;SYSTEM&quot;
        }
    },
    {
        &quot;name&quot;: &quot;JavaScript&quot;,
        &quot;type&quot;: &quot;transform&quot;,
        ...
    },
    ...
]
</pre>
</div>
</div>
<div class="section" id="retrieve-plugin-details">
<span id="http-restful-api-artifact-plugin-detail"></span><h2>Retrieve Plugin Details<a class="headerlink" href="#retrieve-plugin-details" title="Permalink to this headline">🔗</a></h2>
<p>To retrieve details about a specific plugin available to an artifact, submit
an HTTP GET request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">GET /v3/namespaces/&lt;namespace-id&gt;/artifacts/&lt;artifact-name&gt;/versions/&lt;artifact-version&gt;/extensions/&lt;plugin-type&gt;/plugins/&lt;plugin-name&gt;[?scope=&lt;scope&gt;&amp;artifactName=&lt;plugin-artifact-name&gt;&amp;artifactVersion=&lt;plugin-version&gt;&amp;artifactScope=&lt;plugin-scope&gt;&amp;limit=&lt;limit&gt;&amp;order=&lt;order&gt;]</span>
</pre></div>
</div>
<table border="1" class="docutils">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Parameter</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">namespace-id</span></code></td>
<td>Namespace ID</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">artifact-name</span></code></td>
<td>Name of the parent artifact</td>
</tr>
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">artifact-version</span></code></td>
<td>Version of the parent artifact</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">plugin-type</span></code></td>
<td>Type of the plugin</td>
</tr>
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">plugin-name</span></code></td>
<td>Name of the plugin</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">scope</span></code></td>
<td>Optional scope filter of the parent artifact. If not specified, defaults to ‘user’.</td>
</tr>
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">artifact-name</span></code></td>
<td>Optional plugin artifact name filter. If not specified, defaults to returning all
plugins available to the parent artifact.</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">artifact-version</span></code></td>
<td>Optional plugin version filter. All plugin artifact versions within this range will be returned.
It can be an exact version such as <code class="docutils literal notranslate"><span class="pre">1.0.0</span></code> or a version range such as <code class="docutils literal notranslate"><span class="pre">[1.0.0,</span> <span class="pre">2.0.0)</span></code>.
If not specified, defaults to returning all versions of the plugins available to the parent artifact.</td>
</tr>
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">artifact-scope</span></code></td>
<td>Optional plugin scope filter. Scope of the plugin artifact scope. If not specified,
defaults to returning plugins in both the <code class="docutils literal notranslate"><span class="pre">USER</span></code> and <code class="docutils literal notranslate"><span class="pre">SYSTEM</span></code> scopes.</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">limit</span></code></td>
<td>Optional limit filter. Limits the number of the returned results. If not specified,
defaults to returning all plugins which match the requirements.</td>
</tr>
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">order</span></code></td>
<td>Optional order filter. Accepted values are one of <code class="docutils literal notranslate"><span class="pre">DESC</span></code>, <code class="docutils literal notranslate"><span class="pre">ASC</span></code>, or
<code class="docutils literal notranslate"><span class="pre">UNORDERED</span></code>. <code class="docutils literal notranslate"><span class="pre">DESC</span></code> will sort the plugin artifacts first by scope (first by
<code class="docutils literal notranslate"><span class="pre">USER</span></code> and then by <code class="docutils literal notranslate"><span class="pre">SYSTEM</span></code>), then by name descending alphabetically, and then by
version from highest to lowest; for <code class="docutils literal notranslate"><span class="pre">ASC</span></code>, sorted first by scope, then by name
ascending alphabetically, and then by version from lowest to highest. If not
specified, defaults to <code class="docutils literal notranslate"><span class="pre">UNORDERED</span></code>.</td>
</tr>
</tbody>
</table>
<p>This will return a JSON array that lists the plugins of the specified type and name
available to the artifact. As can been seen compared with the endpoint
<a class="reference internal" href="#http-restful-api-artifact-available-plugins"><span class="std std-ref">List Plugins available to an Artifact</span></a>, this provides all details
on the specified plugin. Each element in the array is a JSON object containing the
artifact that the plugin originated from, and the plugin’s class name, description, name,
type, and properties.</p>
<p>Example output for the <code class="docutils literal notranslate"><span class="pre">JavaScript</span></code> plugin available to version <code class="docutils literal notranslate"><span class="pre">6.1.1</span></code>
of the <code class="docutils literal notranslate"><span class="pre">cdap-data-pipeline</span></code> artifact (pretty-printed and reformatted to fit):</p>
<div class="highlight container">
<pre class="literal-block">
<span class="gp">$</span> GET /v3/namespaces/default/artifacts/cdap-data-pipeline/versions/6.1.1/extensions/transform/plugins/JavaScript?scope=system

[
    {
        &quot;name&quot;: &quot;JavaScript&quot;,
        &quot;type&quot;: &quot;transform&quot;,
        &quot;description&quot;: &quot;Executes user-provided JavaScript that transforms one record into zero or more records.&quot;,
        &quot;className&quot;: &quot;io.cdap.hydrator.plugin.transform.JavaScriptTransform&quot;,
        &quot;artifact&quot;: {
            &quot;name&quot;: &quot;core-plugins&quot;,
            &quot;version&quot;: &quot;<a href="#id3"><span class="problematic" id="id4">|cdap-pipelines-version|</span></a>&quot;,
            &quot;scope&quot;: &quot;SYSTEM&quot;
        },
        &quot;properties&quot;: {
            &quot;schema&quot;: {
                &quot;name&quot;: &quot;schema&quot;,
                &quot;description&quot;: &quot;The schema of output objects. If no schema is given,
                it is assumed that the output schema is the same as the input schema.&quot;,
                &quot;type&quot;: &quot;string&quot;,
                &quot;required&quot;: false,
                &quot;macroSupported&quot;: false
            },
            &quot;lookup&quot;: {
                &quot;name&quot;: &quot;lookup&quot;,
                &quot;description&quot;: &quot;Lookup tables to use during transform. Currently
                supports KeyValueTable.&quot;,
                &quot;type&quot;: &quot;string&quot;,
                &quot;required&quot;: false,
                &quot;macroSupported&quot;: false
            },
            &quot;script&quot;: {
                &quot;name&quot;: &quot;script&quot;,
                &quot;description&quot;: &quot;JavaScript defining how to transform input record into
                zero or more records. The script must implement a function called
                'transform', which takes as input a JSON object (representing the
                input record) emitter object, which can be used to emit records and
                error messagesand a context object (which contains CDAP metrics,
                logger and lookup)For example:n'function transform(input, emitter,
                context) {n  if(context.getLookup('blacklist').lookup(input.id) !=
                null) {n     emitter.emitError({&quot;errorCode&quot;:31,
                &quot;errorMsg&quot;:&quot;blacklisted id&quot;, &quot;invalidRecord&quot;: input}); n  }
                else {n     if(input.count &lt; 0) {n
                context.getMetrics().count(&quot;negative.count&quot;, 1);n
                context.getLogger().debug(&quot;Received record with negative count&quot;);n
                   }n  input.count = input.count * 1024;n  emitter.emit(input);   }
                n}'nwill emit an error if the input id is present in blacklist
                table, else scale the 'count' field by 1024&quot;,
                &quot;type&quot;: &quot;string&quot;,
                &quot;required&quot;: true,
                &quot;macroSupported&quot;: false
            }
        },
        &quot;endpoints&quot;: [
        ]
    }
]
</pre>
</div>
</div>
<div class="section" id="delete-an-artifact">
<span id="http-restful-api-artifact-delete"></span><h2>Delete an Artifact<a class="headerlink" href="#delete-an-artifact" title="Permalink to this headline">🔗</a></h2>
<p>To delete an artifact, submit an HTTP DELETE request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">DELETE /v3/namespaces/&lt;namespace-id&gt;/artifacts/&lt;artifact-name&gt;/versions/&lt;artifact-version&gt;</span>
</pre></div>
</div>
<table border="1" class="docutils">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Parameter</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">namespace-id</span></code></td>
<td>Namespace ID</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">artifact-name</span></code></td>
<td>Name of the artifact</td>
</tr>
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">artifact-version</span></code></td>
<td>Version of the artifact</td>
</tr>
</tbody>
</table>
<p>Deleting an artifact is an advanced feature. If there are programs that use the artifact, those
programs will not be able to start unless the artifact is added again, or the program application
is updated to use a different artifact.</p>
</div>
<div class="section" id="load-system-artifacts">
<span id="http-restful-api-artifact-system-load"></span><h2>Load System Artifacts<a class="headerlink" href="#load-system-artifacts" title="Permalink to this headline">🔗</a></h2>
<p>To load all system artifacts on the CDAP Master node(s), submit an HTTP POST request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">POST /v3/namespaces/system/artifacts</span>
</pre></div>
</div>
<p>This call will make the CDAP master scan the artifacts directly and add any new artifacts
that it finds. Any snapshot artifacts will be re-loaded.</p>
</div>
<div class="section" id="delete-a-system-artifact">
<span id="http-restful-api-artifact-system-delete"></span><h2>Delete a System Artifact<a class="headerlink" href="#delete-a-system-artifact" title="Permalink to this headline">🔗</a></h2>
<p>To delete a system artifact, submit an HTTP DELETE request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">DELETE /v3/namespaces/system/artifacts/&lt;artifact-name&gt;/versions/&lt;artifact-version&gt;</span>
</pre></div>
</div>
<table border="1" class="docutils">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Parameter</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">artifact-name</span></code></td>
<td>Name of the artifact</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">artifact-version</span></code></td>
<td>Version of the artifact</td>
</tr>
</tbody>
</table>
<p>Deleting an artifact is an advanced feature. If there are programs that use the artifact, those
programs will not be able to start unless the artifact is added again, or the program application
is updated to use a different artifact.</p>
</div>
<div class="section" id="list-application-classes">
<span id="http-restful-api-artifact-app-classes"></span><h2>List Application Classes<a class="headerlink" href="#list-application-classes" title="Permalink to this headline">🔗</a></h2>
<p>To list application classes, submit an HTTP GET request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">GET /v3/namespaces/&lt;namespace-id&gt;/classes/apps[?scope=&lt;scope&gt;]</span>
</pre></div>
</div>
<table border="1" class="docutils">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Parameter</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">namespace-id</span></code></td>
<td>Namespace ID</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">scope</span></code></td>
<td>Optional scope filter. If not specified, classes from artifacts in the <code class="docutils literal notranslate"><span class="pre">user</span></code> and
<code class="docutils literal notranslate"><span class="pre">system</span></code> scopes are returned. Otherwise, only classes from artifacts in the specified scope are returned.</td>
</tr>
</tbody>
</table>
<p>This will return a JSON array that lists all application classes contained in artifacts.
Each element in the array is a JSON object that describes the artifact the class originates in
as well as the class name. Example output (pretty-printed and reformatted to fit):</p>
<div class="highlight container">
<pre class="literal-block">
<span class="gp">$</span> GET /v3/namespaces/default/classes/apps

[
  {
    &quot;artifact&quot;: {
      &quot;name&quot;: &quot;cdap-data-pipeline&quot;,
      &quot;scope&quot;: &quot;SYSTEM&quot;,
      &quot;version&quot;: &quot;6.1.1&quot;
    },
    &quot;className&quot;: &quot;io.cdap.cdap.datapipeline.DataPipelineApp&quot;
  },
  {
    &quot;artifact&quot;: {
      &quot;name&quot;: &quot;cdap-data-streams&quot;,
      &quot;scope&quot;: &quot;SYSTEM&quot;,
      &quot;version&quot;: &quot;6.1.1&quot;
    },
    &quot;className&quot;: &quot;io.cdap.cdap.datastreams.DataStreamsApp&quot;
  },
  . . .
  {
    &quot;artifact&quot;: {
      &quot;name&quot;: &quot;Purchase&quot;,
      &quot;scope&quot;: &quot;USER&quot;,
      &quot;version&quot;: &quot;6.1.1&quot;
    },
    &quot;className&quot;: &quot;io.cdap.cdap.examples.purchase.PurchaseApp&quot;
  },
]
</pre>
</div>
</div>
<div class="section" id="retrieve-application-class-details">
<span id="http-restful-api-artifact-appclass-detail"></span><h2>Retrieve Application Class Details<a class="headerlink" href="#retrieve-application-class-details" title="Permalink to this headline">🔗</a></h2>
<p>To retrieve details about a specific application class, submit an HTTP GET request:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">GET /v3/namespaces/&lt;namespace-id&gt;/classes/apps/&lt;class-name&gt;[?scope=&lt;scope&gt;]</span>
</pre></div>
</div>
<table border="1" class="docutils">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Parameter</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">namespace-id</span></code></td>
<td>Namespace ID</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">class-name</span></code></td>
<td>Application class name</td>
</tr>
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">scope</span></code></td>
<td>Optional scope filter. If not specified, defaults to <code class="docutils literal notranslate"><span class="pre">user</span></code>.</td>
</tr>
</tbody>
</table>
<p>This will return a JSON array that lists each application class with that class name.
Each element in the array is a JSON object that contains details about the application
class, including the artifact the class is from, the class name, and the schema of
the config supported by the application class.
Example output for the <code class="docutils literal notranslate"><span class="pre">WordCount</span></code> application (pretty-printed and reformatted to fit):</p>
<div class="highlight container">
<pre class="literal-block">
<span class="gp">$</span> GET /v3/namespaces/default/classes/apps/io.cdap.cdap.examples.wordcount.WordCount

[
  {
    &quot;artifact&quot;: {
      &quot;name&quot;: &quot;WordCount&quot;,
      &quot;scope&quot;: &quot;USER&quot;,
      &quot;version&quot;: &quot;6.1.1&quot;
    },
    &quot;className&quot;: &quot;io.cdap.cdap.examples.wordcount.WordCount&quot;,
    &quot;configSchema&quot;: {
      &quot;fields&quot;: [
        { &quot;name&quot;: &quot;stream&quot;, &quot;type&quot;: [ &quot;string&quot;, &quot;null&quot; ] },
        { &quot;name&quot;: &quot;uniqueCountTable&quot;, &quot;type&quot;: [ &quot;string&quot;, &quot;null&quot; ] },
        { &quot;name&quot;: &quot;wordAssocTable&quot;, &quot;type&quot;: [ &quot;string&quot;, &quot;null&quot; ] },
        { &quot;name&quot;: &quot;wordCountTable&quot;, &quot;type&quot;: [ &quot;string&quot;, &quot;null&quot; ] },
        { &quot;name&quot;: &quot;wordStatsTable&quot;, &quot;type&quot;: [ &quot;string&quot;, &quot;null&quot; ] },
      ],
      &quot;name&quot;: &quot;io.cdap.cdap.examples.wordcount.WordCount$WordCountConfig&quot;,
      &quot;type&quot;: &quot;record&quot;
    }
  }
]
</pre>
</div>
</div>
</div>

</div>
    <div class="col-md-2">
      <div id="right-sidebar" class="bs-sidenav scrollable-y" role="complementary">
        <div id="localtoc-scrollspy">
        </div>
      </div>
    </div></div>
</div>
<!-- block main content end -->
<!-- block footer -->
<footer class="footer">
      <div class="container">
        <div class="row">
          <div class="col-md-2 footer-left"><a title="Introduction" href="introduction.html" />Previous</a></div>
          <div class="col-md-8 footer-center"><a class="footer-tab-link" href="../table-of-contents/../../reference-manual/licenses/index.html">Copyright</a> &copy; 2014-2020 Cask Data, Inc.&bull; <a class="footer-tab-link" href="//docs.cask.co/cdap/6.1.1/cdap-docs-6.1.1-web.zip" rel="nofollow">Download</a> an archive or
<a class="footer-tab-link" href="//docs.cask.co/cdap">switch the version</a> of the documentation
          </div>
          <div class="col-md-2 footer-right"><a title="Configuration HTTP RESTful API" href="configuration.html" />Next</a></div>
        </div>
      </div>
    </footer>
<!-- block footer end -->
<script type="text/javascript" src="../_static/bootstrap-3.3.6/js/bootstrap.min.js"></script><script type="text/javascript" src="../_static/js/bootstrap-sphinx.js"></script><script type="text/javascript" src="../_static/js/abixTreeList-2.js"></script><script type="text/javascript" src="../_static/js/cdap-dynamicscrollspy-4.js"></script><script type="text/javascript" src="../_static/js/cdap-version-menu.js"></script><script type="text/javascript" src="../_static/js/copy-to-clipboard.js"></script><script type="text/javascript" src="../_static/js/jquery.mousewheel.min.js"></script><script type="text/javascript" src="../_static/js/jquery.mCustomScrollbar.js"></script><script type="text/javascript" src="../_static/js/js.cookie.js"></script><script type="text/javascript" src="../_static/js/tabbed-parsed-literal-0.2.js"></script><script type="text/javascript" src="../_static/js/cdap-onload-javascript.js"></script><script type="text/javascript" src="../_static/js/cdap-version-menu.js"></script>
    <script src="https://cdap.gitee.io/docs/cdap/json-versions.js"/></script>
  </body>
</html>